package com.paco.study.cloud.email.controller;

import com.paco.study.cloud.email.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("email")
public class EmailController {

    @Autowired
    private EmailService emailService;

//    发送验证码
    @GetMapping("/{email}/{code}")
    public boolean send(
            @PathVariable String email,
            @PathVariable String code
    ) {
        return emailService.send(email, code);

    }


}
